%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left

    subgraph "Buckets for mutations/v4/inheritence.createUserFile"
    Bucket0("Bucket 0 (root)"):::bucket
    Bucket1("Bucket 1 (mutationField)<br />Deps: 14, 15, 26<br /><br />1: PgInsertSingle[11]<br />2: <br />ᐳ: Object[16]"):::bucket
    Bucket2("Bucket 2 (mutationField)<br />Deps: 24, 2<br /><br />1: Access[21]<br />2: Access[22]<br />3: Object[23]<br />4: PgInsertSingle[20]<br />5: <br />ᐳ: Object[25]"):::bucket
    Bucket3("Bucket 3 (nullableBoundary)<br />Deps: 16, 11, 26<br /><br />ROOT Object{1}ᐸ{result}ᐳ[16]"):::bucket
    Bucket4("Bucket 4 (nullableBoundary)<br />Deps: 2, 20, 25<br /><br />ROOT Object{2}ᐸ{result}ᐳ[25]"):::bucket
    Bucket5("Bucket 5 (nullableBoundary)<br />Deps: 11, 26<br /><br />ROOT PgInsertSingle{1}ᐸuser()ᐳ[11]"):::bucket
    Bucket6("Bucket 6 (nullableBoundary)<br />Deps: 20, 40<br /><br />ROOT PgInsertSingle{2}ᐸuser_file()ᐳ[20]<br />1: <br />ᐳ: 32, 31, 34, 36<br />2: PgSelect[37]<br />3: PgSelectRows[42]<br />ᐳ: First[41], PgSelectSingle[43]"):::bucket
    Bucket7("Bucket 7 (nullableBoundary)<br />Deps: 43, 20<br /><br />ROOT PgSelectSingle{6}ᐸuserᐳ[43]"):::bucket
    end
    Bucket0 --> Bucket1 & Bucket2
    Bucket1 --> Bucket3
    Bucket2 --> Bucket4
    Bucket3 --> Bucket5
    Bucket4 --> Bucket6
    Bucket6 --> Bucket7

    %% plan dependencies
    __InputObject18{{"__InputObject[18∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]<br />- Constantᐸ'foo.txt'ᐳ[48]<br />- Constantᐸ1ᐳ[46]"}}:::plan
    __InputObject6{{"__InputObject[6∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]"}}:::plan
    __InputObject8{{"__InputObject[8∈0] ➊<br />More deps:<br />- Constantᐸ1ᐳ[46]<br />- Constantᐸ'Bobby Tables'ᐳ[47]"}}:::plan
    __InputObject8 --> __InputObject6
    Object14{{"Object[14∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access12{{"Access[12∈0] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access13{{"Access[13∈0] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access12 & Access13 --> Object14
    __InputObject17{{"__InputObject[17∈0] ➊<br />More deps:<br />- Constantᐸundefinedᐳ[7]"}}:::plan
    __InputObject18 --> __InputObject17
    ApplyInput15{{"ApplyInput[15∈0] ➊"}}:::plan
    __InputObject6 --> ApplyInput15
    ApplyInput24{{"ApplyInput[24∈0] ➊"}}:::plan
    __InputObject17 --> ApplyInput24
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ<br />Dependents: 6"]:::plan
    PgInsertSingle11[["PgInsertSingle[11∈1] ➊<br />ᐸuser()ᐳ"]]:::sideeffectplan
    Object14 & ApplyInput15 --> PgInsertSingle11
    Object16{{"Object[16∈1] ➊<br />ᐸ{result}ᐳ"}}:::plan
    PgInsertSingle11 --> Object16
    PgInsertSingle20[["PgInsertSingle[20∈2] ➊<br />ᐸuser_file()ᐳ"]]:::sideeffectplan
    Object23{{"Object[23∈2] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Object23 & ApplyInput24 --> PgInsertSingle20
    Access21{{"Access[21∈2] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access22{{"Access[22∈2] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access21 & Access22 --> Object23
    Object25{{"Object[25∈2] ➊<br />ᐸ{result}ᐳ"}}:::plan
    PgInsertSingle20 --> Object25
    Object40{{"Object[40∈4] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Access38{{"Access[38∈4] ➊<br />ᐸ2.pgSettingsᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access39{{"Access[39∈4] ➊<br />ᐸ2.withPgClientᐳ<br />More deps:<br />- __Value[2]"}}:::plan
    Access38 & Access39 --> Object40
    List29{{"List[29∈5] ➊<br />ᐸ26,27ᐳ<br />More deps:<br />- Constantᐸ'users'ᐳ[26]"}}:::plan
    PgClassExpression27{{"PgClassExpression[27∈5] ➊<br />ᐸ__user__.”id”ᐳ"}}:::plan
    PgClassExpression27 --> List29
    Access28{{"Access[28∈5] ➊<br />ᐸ11.tᐳ"}}:::plan
    Access28 --> PgClassExpression27
    PgInsertSingle11 --> Access28
    Lambda30{{"Lambda[30∈5] ➊<br />ᐸbase64JSONEncodeᐳ"}}:::plan
    List29 --> Lambda30
    PgClassExpression35{{"PgClassExpression[35∈5] ➊<br />ᐸ__user__.”name”ᐳ"}}:::plan
    Access28 --> PgClassExpression35
    PgSelect37[["PgSelect[37∈6] ➊<br />ᐸuserᐳ"]]:::plan
    PgClassExpression36{{"PgClassExpression[36∈6] ➊<br />ᐸ__user_file__.”user_id”ᐳ"}}:::plan
    Object40 & PgClassExpression36 --> PgSelect37
    PgClassExpression31{{"PgClassExpression[31∈6] ➊<br />ᐸ__user_file__.”id”ᐳ"}}:::plan
    Access32{{"Access[32∈6] ➊<br />ᐸ20.tᐳ"}}:::plan
    Access32 --> PgClassExpression31
    PgInsertSingle20 --> Access32
    PgClassExpression34{{"PgClassExpression[34∈6] ➊<br />ᐸ__user_fil...”filename”ᐳ"}}:::plan
    PgClassExpression31 o--o PgClassExpression34
    Access32 --> PgClassExpression36
    First41{{"First[41∈6] ➊"}}:::plan
    PgSelectRows42[["PgSelectRows[42∈6] ➊"]]:::plan
    PgSelectRows42 --> First41
    PgSelect37 --> PgSelectRows42
    PgSelectSingle43{{"PgSelectSingle[43∈6] ➊<br />ᐸuserᐳ"}}:::plan
    First41 --> PgSelectSingle43
    PgClassExpression44{{"PgClassExpression[44∈7] ➊<br />ᐸ__user__.”id”ᐳ"}}:::plan
    PgSelectSingle43 --> PgClassExpression44
    PgClassExpression45{{"PgClassExpression[45∈7] ➊<br />ᐸ__user__.”name”ᐳ"}}:::plan
    PgClassExpression44 o--o PgClassExpression45

    %% define steps
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,__InputObject6,__InputObject8,Access12,Access13,Object14,ApplyInput15,__InputObject17,__InputObject18,ApplyInput24 bucket0
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgInsertSingle11,Object16 bucket1
    classDef bucket2 stroke:#7f007f
    class Bucket2,PgInsertSingle20,Access21,Access22,Object23,Object25 bucket2
    classDef bucket3 stroke:#ffa500
    class Bucket3 bucket3
    classDef bucket4 stroke:#0000ff
    class Bucket4,Access38,Access39,Object40 bucket4
    classDef bucket5 stroke:#7fff00
    class Bucket5,PgClassExpression27,Access28,List29,Lambda30,PgClassExpression35 bucket5
    classDef bucket6 stroke:#ff1493
    class Bucket6,PgClassExpression31,Access32,PgClassExpression34,PgClassExpression36,PgSelect37,First41,PgSelectRows42,PgSelectSingle43 bucket6
    classDef bucket7 stroke:#808000
    class Bucket7,PgClassExpression44,PgClassExpression45 bucket7

    %% implicit side effects
    PgInsertSingle20 -.-o Access38
    PgInsertSingle20 -.-o Access39

